package YourSpace::Controller::Logout;
# $WCREV WVDATE$
use strict;
use warnings;
use base 'Catalyst::Controller';

=head1 NAME

YourSpace::Controller::Logout - Catalyst Controller

=head1 DESCRIPTION

Catalyst Controller.

=head1 METHODS

=cut


=head2 index 

=cut

sub index : Private {
    my ( $self, $c ) = @_;

    #$c->response->body('Matched YourSpace::Controller::Logout in Logout.');

    my $next_page = $c->request->params->{next_page};
    $c->flash->{status_msg}    = "You've been logged out!";
    # Clear the user's state
    $c->logout;

    # Send the user to the  original page
    $c->response->redirect( $c->uri_for($next_page) );
	
}


=head1 AUTHOR

A clever guy

=head1 LICENSE

This library is free software, you can redistribute it and/or modify
it under the same terms as Perl itself.

=cut

1;
